<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page import="avicit.platform6.commons.utils.ViewUtil"%>
<%@ taglib prefix="sec" uri="/WEB-INF/tags/shiro.tld"%>
<html>
<head>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加</title>
<base href="<%=ViewUtil.getRequestPath(request)%>">
<jsp:include
	page="/avicit/platform6/component/common/EasyUIJsInclude.jsp"></jsp:include>
<jsp:include page="/avicit/im/common/ImUIJSCSSInclude.jsp"></jsp:include>
<script type="text/javascript"
	src="avicit/im/lantop/basic/libstructuredefine/LantopArchiveClassAdd.js"></script>
<link href="static/css/custom/lantop/css/custom.css" type="text/css"  rel="stylesheet">
<script type="text/javascript">
	var baseurl = '<%=request.getContextPath()%>';
	var dialogId = "${dialogId}"; //当前对话框的ID
	$(function() {
		$("#layerType + .combo").hide();
		$("#layerTypeSpan").hide();
		//初始化类型为0
		$("#archiveType").attr("value", "0");
		//模板库点击事件
		$("#selectTemp").combobox({
			readonly : true,
			onSelect : function(record) {
				$("#archiveType").attr("value", record.value);
			}
		});

		//层级点击事件
		$("#tableLayer").combobox({
			readonly : true,
			onSelect : function(record) {
				var selectTemp = $("#selectTemp").combobox("getValue");//库表类型
				if(record.value == "1"){
					getArchiveClassType(selectTemp,1);
				}else{
					getArchiveClassType(selectTemp,1);
					getArchiveClassType(selectTemp,2);
				}
				var selectValue = $("input[name='redio']:checked").val();
				//层级为3,模板库选中状态
				if (record.value == "3" && selectValue == "2") {
					$("#addGridIframe").css("display", "block");
					$.parser.parse('#addGridIframe');
				} else {
					$("#addGridIframe").css("display", "none");
				}
				//add by gl 2016-01-05 层级为2,模板库选中状态,显示两层类型下拉列表 start 
				if (record.value == "2" && selectValue == "2") {
					$("#layerTypeSpan").show();
					$("#layerType + .combo").show();
				} else {
					$("#layerTypeSpan").hide();
					$("#layerType + .combo").hide();
				}
				//add by gl 2016-01-05 层级为2,模板库选中状态,显示两层类型下拉列表 end
			}
		});
	});
	
	$.extend($.fn.validatebox.defaults.rules, {
		xy: {
	        validator: function(value,param){
	        	var jiedianName = $("#archiveClassNodeName").val();
	        	var regEn = /[`~!@$%^&*()+<>?:"{},.\;'[\]]/im,
	            regCn = /[·！￥：；“”‘，|《。》？\\\\【】[\]]/im;
	        	if(regEn.test(jiedianName) || regCn.test(jiedianName)) {
	        		return false;
	        	}else{
	        		return true;
	        	}   
	        },    
	        message: '名称不能含有特殊字符'  
	    }
	});
</script>
	<style>
		.divw{
			display: inline-block;
			padding: 3px 0;
			width: 230px;
		}
	</style>
</head>
<body fit="true">
	<div id="mainBody" class="easyui-layout" fit="true">
		<div region="north" border="false"
			style="height: 400px; overflow-y: hidden;">
			<form id="formAdd" method="post">
				<table class="table_init" style="width: 90%;">
					<tr>
						<sec:accesscontrollist hasPermission="3"
							domainObject="formdialog_ClassAdd_formAdd_archiveClassNodeCode">
							<th width="10%" align="right"><span class="remind">*</span>名称：</th>
							<td width="40%" colspan="5"><input
								class="easyui-validatebox" type="text" id="archiveClassNodeName"
								name="archiveClassNodeName" validType="xy[0,200]"
								data-options="required:true,validType:'length[1,20]'"
								onchange="nameOnChange(value)"></input></td>
						</sec:accesscontrollist>
					</tr>
					<tr>
						<sec:accesscontrollist hasPermission="3"
							domainObject="formdialog_ClassAdd_formAdd_archiveClassNodeName">
							<th width="10%" align="right"><span class="remind">*</span>标识：</th>
							<td width="40%" colspan="5"><input
								class="easyui-validatebox" type="text" id="archiveClassNodeCode"
								name="archiveClassNodeCode"
								data-options="required:true,validType:'length[1,20]'"></input></td>
						</sec:accesscontrollist>
					</tr>
					<tr>
						<sec:accesscontrollist hasPermission="3"
							domainObject="formdialog_ClassAdd_formAdd_archiveClassNodeName">
							<td><span class="block-box"> <input class="radiobox" style="float: left;"
									type="radio" title="模板文件夹" id="folder" name="redio"
									checked=true onclick="changePlanType(1)" value="1" /> <span
									class="radiobox-text">模板文件夹</span>
							</span></td>
						</sec:accesscontrollist>
					</tr>
					<tr>
						<sec:accesscontrollist hasPermission="3"
							domainObject="formdialog_ClassAdd_formAdd_archiveClassNodeName">
							<td width="15%"><span class="block-box"> <input style="float: left;"
									class="radiobox" style="width: 10%;" type="radio" id="template"
									title="模板库" name="redio" value="2" onclick="changePlanType(2)" />
									<span class="radiobox-text">模板库：</span>
							</span></td>
							<td width="20%"><select title="模板库" editable="false"
								data-options="panelHeight:200,editable:false,onShowPanel:comboboxOnShowPanel,onChange:onChangetArchiveType"
								class="easyui-combobox" name="selectTemp" id="selectTemp">
									<c:forEach items="${lanTopArchiveTypeList}"
										var="lanTopArchiveTypeList">
										<option value="${lanTopArchiveTypeList.lookupCode}">${lanTopArchiveTypeList.lookupName}</option>
									</c:forEach>
							</select></td>
							<th width="15%" align="right">库表层层级：</th>
							<td width="20%"><select class="easyui-combobox"
								id="tableLayer" name="tableLayer"
								data-options="panelHeight:'auto',editable:false,onShowPanel:comboboxOnShowPanel">
									<option value="1">1</option>
									<option value="2">2</option>
									<!-- <option value="3">3</option> -->
							</select></td>
							<th width="10%" align="right"><span id="layerTypeSpan">结构类型
							</span></th>
							<td width="20%"><input id="layerType" name="layerType"
								style="width: 60px;" class="easyui-combobox"
								data-options="panelHeight:'auto',editable:false,valueField: 'value',textField: 'label',data: [{label: '案卷级',value: '0','selected':true},{label: '盒级',value: '1'}],onShowPanel:comboboxOnShowPanel" />
							</td>
						</sec:accesscontrollist>
					</tr>
				</table>
				<input name="archiveType" id="archiveType" style="display: none;" />
				<input name="parentId" id="parentId" style="display: none;"
					value="${lantopArchiveClass.id}" />
			</form>
			<div id="commTempletsIdan" style="overflow:auto;height: 125px;width: 100%;padding: 10px;box-sizing:border-box;font-size: 16px;border-top:1px solid #dedede;">
				<div style="padding-left: 3px;">卷级：</div>
			</div>
			<div id="commTempletsIdwen" style="overflow:auto;height: 125px;width: 100%;padding: 10px;box-sizing:border-box;font-size: 16px;border-top:1px solid #dedede;">
				<div style="padding-left: 3px;">件级：</div>
			</div>
		</div>
		<div region="center" border="false" style="border-top:">
			<div id="addGridIframe" style="display: none;">
				<div id="toolbar" class="datagrid-toolbar" style="height: auto;">
					<table>
						<tr>
							<td align="left"><a class="easyui-linkbutton"
								iconCls="icon-im-add" plain="true" id="addQuotaButton"
								onclick="append();" href="javascript:void(0);">添加</a> <a
								class="easyui-linkbutton" iconCls="icon-im-remove" plain="true"
								id="addQuotaButton" onclick="removeit();"
								href="javascript:void(0);">删除</a></td>
						</tr>
					</table>
				</div>
				<div
					style="padding: 5px; overflow: auto; height: 150px; font-size: 0;">
					<table id="classGrid" class="easyui-datagrid"
						data-options="
						method: 'post',
						rownumbers: true,
						animate: true,
						collapsible: false,
						pagination:false,
						rownumbers:true,
						fit:true,
						fitColumns: true,
						singleSelect: false,
						striped:false,
						toolbar:'#toolbar',
						autoRowHeight: false,
						onClickRow: onClickRow
					">
						<thead>
							<tr>

								<th data-options="field:'id',align:'left',checkbox: true"></th>
								<sec:accesscontrollist hasPermission="3"
									domainObject="LantopArchiveClass_LantopArchiveClassAdd_table_name">
									<th
										data-options="field:'name',align:'center', editor:{type:'validatebox',options:{required:true,validType:'length[0,10]'}}"
										width="50" title="名称"><img
										src="avicit/im/common/im_themes_extend/required.gif" alt="必填">名称</th>
								</sec:accesscontrollist>

							</tr>
						</thead>
					</table>
				</div>
			</div>
		</div>
		<div data-options="region:'south',border:false" style="height: 40px;">
			<div id="toolbar">
				<table class="tableForm" border="0" cellspacing="1" width="100%">
					<tr>
						<sec:accesscontrollist hasPermission="3"
							domainObject="formdialog_LantopArchiveClassAdd_formAdd__button_saveForm">
							<td align="center"><a title="保存" id="saveButton"
								class="easyui-linkbutton selbtnc" iconCls="icon-im-save" onclick="saveForm();"
								href="javascript:void(0);">保存</a> <a title="返回"
								id="returnButton" class="easyui-linkbutton selbtnc" iconCls="icon-im-back"
								onclick="closeForm();" href="javascript:void(0);">返回</a></td>
						</sec:accesscontrollist>
					</tr>
				</table>
			</div>
		</div>
	</div>
</body>
</html>
